﻿using gecommon;
using SuperSocket.SocketBase;
using SuperSocket.SocketBase.Protocol;
using SuperSocket.WebSocket;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace gegateway
{
    public class GatewayServer : WebSocketServer<GatewaySession>
    {
        private Thread _thread;
        public GatewayServer()
        {

        }

        protected override void OnStarted()
        {
            Console.WriteLine(TaskScheduler.Current.MaximumConcurrencyLevel);
            base.OnStarted();
            //启动一个消费者线程
            _thread = new Thread(this.ConsumeLoop);
            _thread.Start();
        }
        private void ConsumeLoop()
        {
            var ch = Channel.Instance();
            while (true)
            {
                var rsp = ch.Recv4Gate();
                //根据rsp结构发送给指定的人
                //this.GetAllSessions();
            }
        } 
    }
}
